//
//  TableVC.h
//  
//  jhf
//
//  Created by Mac on 2019/12/6.
//  Copyright © 2019 Mac. All rights reserved.
//

#import "TableVCVM.h"
#import <CooperSDK/CooperSDK.h>
#import "TableNavbarV.h"


NS_ASSUME_NONNULL_BEGIN

@interface TableVC : CPBaseVC

@property (strong, nonatomic) UITableView *tableview;

@property (strong, nonatomic) TableVCVM *vm;

/// 延时 realod table 信号
@property (nonatomic, assign) NSInteger reloadCount;
@property (nonatomic, strong) RACSubject *delayReloadSubject;

/// 传递信号
@property (nonatomic, copy) BlockId transmitBlock; // 传递信号

/// 滚动到第几个
@property (nonatomic, assign) BOOL scrollTo; // default false

// MARK: - 下拉上拉
@property (nonatomic, assign) BOOL enablePull; // default false
@property (nonatomic, assign) BOOL enablePush; // default false
@property (nonatomic, assign) int pagesize; // default 10

// MARK: - tap empty
@property (nonatomic, assign) BOOL enableTapEmpty;  // default false
@property (nonatomic, assign) BOOL enableLongPress; // default false

// MARK: - tap empty config
@property (nonatomic, assign) BOOL enableEmptyConifg; // default false

@property (nonatomic, strong) CPEmptyDataConfig *emptyConifg;

// MARK: - key value
@property (nonatomic, strong, readonly) NSArray <NSString *>*keys;
@property (nonatomic, strong, readonly) NSArray *values;

/// 修改单个navbar样式
@property (nonatomic, strong) AGGNavControlModel *navbarC;
@property (nonatomic, strong) TableNavbarV *navigationV;

/// 绑定的key
@property (nonatomic, copy) NSString *bindKey;

/// 传递信号
@property (nonatomic, copy) BlockId block;

/// 是否待刷新
@property (nonatomic, assign) BOOL isRefreshIng;

/// 节流时间 默认0.3
@property (nonatomic, assign) CGFloat throttleTime;

// MARK: - 默认方法
/// 配置keys和values
- (void)configKeys:(NSArray <NSString *> *)keys values:(NSArray *)values;

/// 判断是否持有vm
- (BOOL)isVM:(TableVCVM *)vm;

- (BOOL)isVmClass:(NSString *)vmStr;

/// 处理点击方法
- (void)actionTo:(id)model;

// MARK: - 初始化
+ (instancetype)vcWithClassStr:(NSString *)clsStr;
+ (instancetype)vcWithClassStr:(NSString *)clsStr model:(id)model;

+ (instancetype)vcWithClass:(Class)cls;
+ (instancetype)vcWithClass:(Class)cls model:(id)model ;

@end

NS_ASSUME_NONNULL_END
